#include <iostream>
#include <header.h>
using std::cout;
using std::endl;

void test0(){
    int *p = (int*)malloc(sizeof(int));
    *p = 101;
    cout << *p << endl;
    free(p);	

    /* 在堆上申请int类型数据空间，并且初值为4 */
    int *p1 = new int(4);
    cout << *p1 << endl;
    delete(p1);

    /* 初始化为默认值 */
    int *p2 = new int();
    cout << *p2 << endl;
    delete(p2);

    char *p3 = new char();
    cout << *p3 << endl;
    delete(p3);
    p3 = nullptr;

}
void test1(){
    int *p = new int[10]{1,2,3,4,5,6,7,8,9,10};

    for (int i = 0; i < 10; i++){
        cout << p[i] << " ";
    }
    cout << endl;
}

void test2(){
    // c++字符串
    const char *p = "hello";
    cout << p << endl;

    /**
     * cout 对char类型指针有默认重载效果
    */
}

int main(int argc, char* argv[]){
	ARGS_CHECK(argc, 1);
    test2();
	return 0;
}